package main

import (
	"os"

	"github.com/gin-gonic/gin"
	"github.com/spf13/viper"
)


func main() {
	InitConfig()
	e := gin.Default()
	e = CollectRoute(e)

	e.Run()
}

func InitConfig() {
	workDir, _ := os.Getwd()
	viper.SetConfigName("app")
	viper.SetConfigType("yaml")
	viper.AddConfigPath(workDir + "/config")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
}

